package week05.test;

import java.util.Random;

public class GraphicProxy implements Element {
    private  Element element;
    public GraphicProxy(Element element){

        this.element=element;
    }
    @Override
    public void draw() {
        Random rand=new Random();
        if(rand.nextBoolean()){
            System.out.println("直接加载图片");
            element.draw();
        }
        else{
            System.out.println("显示一个带X的虚拟图片");
        }

    }
}
